package com.toilet.easyvideofx.domain;

import java.io.Serial;
import java.io.Serializable;
import java.util.Arrays;

/**
 * 系统全局缓存
 *
 * @TableName sys_global_cache
 */
public class SysGlobalCache implements Serializable {
    @Serial
    private static final long serialVersionUID = 1L;
    /**
     * 主键id
     */
    private Long id;

    /**
     * 缓存索引
     */
    private String cacheIndex;

    /**
     * 缓存过期时间
     */
    private Long outTime;

    /**
     * 缓存值
     */
    private byte[] cacheValue;

    /**
     *
     */
    public Long getId() {
        return id;
    }

    /**
     *
     */
    public void setId(Long id) {
        this.id = id;
    }

    /**
     *
     */
    public String getCacheIndex() {
        return cacheIndex;
    }

    /**
     *
     */
    public void setCacheIndex(String cacheIndex) {
        this.cacheIndex = cacheIndex;
    }

    /**
     *
     */
    public Long getOutTime() {
        return outTime;
    }

    /**
     *
     */
    public void setOutTime(Long outTime) {
        this.outTime = outTime;
    }

    /**
     *
     */
    public byte[] getCacheValue() {
        return cacheValue;
    }

    /**
     *
     */
    public void setCacheValue(byte[] cacheValue) {
        this.cacheValue = cacheValue;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        SysGlobalCache other = (SysGlobalCache) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
                && (this.getCacheIndex() == null ? other.getCacheIndex() == null : this.getCacheIndex().equals(other.getCacheIndex()))
                && (this.getOutTime() == null ? other.getOutTime() == null : this.getOutTime().equals(other.getOutTime()))
                && (Arrays.equals(this.getCacheValue(), other.getCacheValue()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getCacheIndex() == null) ? 0 : getCacheIndex().hashCode());
        result = prime * result + ((getOutTime() == null) ? 0 : getOutTime().hashCode());
        result = prime * result + (Arrays.hashCode(getCacheValue()));
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", cacheIndex=").append(cacheIndex);
        sb.append(", outTime=").append(outTime);
        sb.append(", cacheValue=").append(cacheValue);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}